home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.2 / Video Toaster v4.2.iso / arexx / editor / maxlength.rexx < prev    next >
OS/2 REXX Batch file  |  1995-11-21  |  3KB  |  102 lines

  1. /* MaxLength.rexx V3.5 -- Maximize vide and audio croutons.               */
  2. /* By Bob Caron (Grue) ©1995 NewTek Inc.                                  */
  3.  
  4. arg frompopup
  5. if frompopup="" then frompopup=0
  6.  
  7. call remlib('PROJECT_REXX_PORT')
  8.  
  9. call addlib('PROJECT_REXX_PORT',0)
  10. call set_view(2)
  11.  
  12. call req_error("Max Length V3.5     ---    Maximize video and audio croutons.")
  13.  
  14. done=0
  15. do while done=0
  16.   selection=req_tell("Max Length V3.5","'Continue' to effect ALL croutons","'Cancel' to effect selected croutons")
  17.   done=1
  18.   if selection=0 & frompopup=0 then do
  19.     if req_tell("Error:","You can only use this feature if you","launch this script from the tools","popup menu.")=0 then call quit()
  20.     done=0
  21.     end
  22. end
  23. if selection=1 then frompopup=0 else frompopup=1
  24.  
  25. project_end=croutonsinproject()
  26. location=1
  27. do count=1 to project_end
  28.   if croutonselectedpos(count)=1 | frompopup=0 then do
  29.      selected.location=count-1
  30.      location=location+1
  31.      end
  32. end
  33.  
  34. location=location-1
  35.  
  36. vidin=0;vidout=0;audin=0;audout=0;done=-1
  37. buttons='1111'
  38. do while done=-1
  39.   buttons=req_buttons("What would you like to maximize:",buttons,"Video In","Video Out","Audio In","Audio Out")
  40.   if buttons="CANCEL" then call quit
  41.  
  42.   if substr(buttons,1,1)="1" then do
  43.      vidin=1; done=1
  44.      end
  45.   if substr(buttons,2,1)="1" then do
  46.      vidout=1; done=1
  47.      end
  48.   if substr(buttons,3,1)="1" then do
  49.      audin=1; done=1
  50.      end
  51.   if substr(buttons,4,1)="1" then do
  52.      audout=1; done=1
  53.      end
  54. end
  55.  
  56. if frompopup="0" then do
  57.    if req_tell("Change ALL In and Out points","            Are You Sure?")=0 then call quit()
  58. end
  59. else
  60.    if req_tell("Change Selected In and Out points","            Are You Sure?")=0 then call quit()
  61.  
  62. extravid=0
  63. extraaud=0
  64. chunk=100/location
  65. last=0
  66. dots=0
  67. call req_open("Working... Please wait.")
  68. do count=1 to location
  69.    if crnumtype(selected.count)="CLIP"  | crnumtype(selected.count)=" AUD" then do
  70.       if vidout=1 then call crnumsettag(selected.count,Duration,crnumGetTag(selected.count,RecFields))
  71.       if audout=1 then call crnumsettag(selected.count,AudioDuration,crnumGetTag(selected.count,RecFields))
  72.       if vidin=1 then  call crnumsettag(selected.count,ClipStartField,0)
  73.       if audin=1 then  call crnumsettag(selected.count,AudioStart,0)
  74.       end
  75.    last=trunc(dots/10)+1
  76.    dots=dots+chunk;string=copies(".",trunc(dots/10)+1)
  77.    if (last~=trunc(dots/10)+1) then do
  78.       if (11-length(string)>-1) then
  79.          call req_error("[Working"||string||right('          ',11-length(string))||"]")
  80.       end
  81. end
  82. call req_close()
  83.  
  84. call req_error("")
  85. call req_error("All done.")
  86. call projectupdate()
  87. call remlib("PROJECT_REXX_PORT")
  88. exit
  89.  
  90. quit:
  91.  
  92. call req_error("Canceled.")
  93. call remlib("PROJECT_REXX_PORT")
  94.  
  95. exit
  96.  
  97. croutonselectedpos:
  98. arg pos
  99. row=trunc(pos/8)
  100. col=pos-(row*8)
  101. row=row+1
  102. return croutonselected(row,col)